<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script
        src="https://dss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/jquery/jquery-1.10.2.min_65682a2.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>

<body>
    <div id="app">
        <!-- <div>
            用户名：<input type="text" v-model="username" />
        </div>
        <div>
            密码：<input type="text" v-model="password" />
        </div>
        <div >
            验证码：<input type="text" v-model="code" />
            <img :src="url" alt="" @click="getcode()">
        </div> -->
        <div @click="login()">登入</div>
    </div>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                username:'cc',
                password:'cc',
                code:'ATIX3',
                url:'',
                helloData: {}
            },
            created() {
                this.getcode();
                
            },
            methods: {
                getcode(){
                    var a=new Date();
                    this.url='http://localhost:8080/getcode?time='+a.getTime();
                },
                login(){
                    // $.post("http://localhost:8080/login", 
                    // { username: this.username, password: this.password,code:this.code },
                    // function(data){
                    //     console.log(data)
                    //     // window.location.href=`/showList.html
                    // });
                    $.ajax({
                            type: "POST",
                            url: "http://localhost:8080/my/getUser",
                            data:{
                                id:2
                            },
                            function (params) {
                                console.log(params)
                            }
                            });
                }
            }
        })
    </script>
</body>

</html>